import pandas as pd

pd_1 = pd.Series([1, 2, 3, 4, 5, 6])
print(pd_1)
print(type(pd_1))

pd_2 = pd.Series([1, 23, 3, 4, 5], index=list("abcde"))
print(pd_2)

temp_dict = {"name": "ywc", "age": 30, "tel": "020"}
pd_3 = pd.Series(temp_dict)
print(pd_3)

print(pd_3.dtype)
pd_1.astype(float)

print(pd_3["age"])
print(pd_3[1])
print(pd_3[:2]) # 取前两行
print(pd_3[[1,2]]) # 取不连续的行
print(pd_3[["age", "tel"]])
print(pd_3.index)
for i in pd_3.index:
    print(i)
print(type(pd_3.index))
print(list(pd_3.index))
print(list(pd_3.index)[:2])

print(pd_3.values)
for i in pd_3.values:
    print(i)
print(type(pd_3.values))
print(list(pd_3.values))
print(list(pd_3.values)[:2])



